package com.back.vo;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * 注册时对应的视图数据类（view object），
 * 用于接收并处理 注册时的数据。
 */
@Data
public class RegisterVo {
    @NotEmpty(message = "{sys.user.name.notEmpty}")
    @Pattern(message = "{sys.user.name.format.error}", regexp = "^.*[^\\d].*$")
    private String userName;
    @NotEmpty(message = "{sys.user.password.notEmpty}")
    private String password;
    @NotEmpty(message = "{sys.user.phone.notEmpty}")
    @Pattern(message = "{sys.user.phone.format.error}", regexp = "0?(13|14|15|18|17)[0-9]{9}")
    private String phone;
    @NotEmpty(message = "{sys.user.email.notEmpty}")
    @Pattern(message = "{sys.user.email.format.error}", regexp = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$")
    private String email;
    
}
